<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>约健</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {include file="public:headfile"}
</head>

<body class="hold-transition sidebar-mini">
<div class="wrapper">

    {include file="public:head"}

    {include file="public:slidemenu"}

    <div class="content-wrapper">

        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1>用户列表</h1>

                    </div>
                </div>
            </div>
        </section>



        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-header">
                            <h3 class="card-title">用户列表
                            <form class="pull-right" action="{:url('SuperAdmin/UsersController/search')}" method="post" enctype="multipart/form-data">
                                        <div class="input-group"><input type="text" class="form-control" placeholder="请输入关键词" name="content">
                                      <div class="input-group-append"> <button  type="submit" class="btn btn-primary">搜索</button></div></div>
                                    </form></h3>
                        </div>
                        <!-- /.card-header -->
                        <div class="card-body">
                            <table id="example2" class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>用户名</th>
                                    <th>用户头像</th>
                                    <th>联系电话</th>
                                    <th>邮箱</th>
                                    <th>订单数量</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                  <?php use think\Db; ?>
                                {volist name="list" id="vo"}
                                <tr>
                                    <td>{$vo.uid}</td>
                                    <td>{$vo.uname}</td>
                                    <td><img src="__STATIC__/img/userimg/{$vo.upic} " style="width: 70px;height:70px"></td>
                                    <td>{$vo.utel}</td>
                                    <td>{$vo.uemail}</td>
                                    <td>                     
                                    <?php echo $list1=Db::name('enroll')->where('uid',$vo['uid'])->count(); ?>
                                    </td>
                                    <td>
                                    <button>
                                        <a style="color: black" href="{:url('SuperAdmin/UsersController/delete',['id'=>$vo.uid])}">
                                        删除
                                        </a>
                                     </button></td>
                                </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>
                        <!-- /.card-body -->
                        <div class="dataTables_paginate paging_simple_numbers">{$list->render()}</div>
                    </div>
                    <!-- /.card -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </section>
        <!-- /.content -->

    </div>
</div>

<script type="text/javascript">
        function jsedit(uid)
        {
            //console.log(aid);
           $.ajax({
            url:"{:url('UsersController/show')}",
            data:{
                "uid":uid
            },
            dataType:'json',
            success(data){
               console.log(data);
          $("#name").val(data.uname);

          $("#password").val(data.upassword);

          $("#email").val(data.uemail);

           $("#tel").val(data.utel);

           $("#hidden").val(data.uid);

          $("#edit").modal.show;

            }
        }); 
        }

    </script>
{include file="public:footfile"}

</body>

</html>